package com.s_statusbar;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.s7.statusbar.StatusBarCompat;

public class DesignActivity extends AppCompatActivity {

    private Toolbar toolbar;
    private CollapsingToolbarLayout collapsingToolbar;
    private AppBarLayout barLayout;
    private ImageView header;

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_design);
        header = findViewById(R.id.header);
        toolbar = findViewById(R.id.toolbar);
        collapsingToolbar = findViewById(R.id.collapsing_toolbar);
        barLayout = findViewById(R.id.bar_layout);
        toolbar.setTitle("测试");

        collapsingToolbar.setExpandedTitleColor(0xFFFFFFFF);
        collapsingToolbar.setCollapsedTitleTextColor(0xFF333333);
        StatusBarCompat.setCollapsingToolbar(this, barLayout, collapsingToolbar, toolbar, Color.GREEN);
    }

}
